-
Notifications
You must be signed in to change notification settings - Fork 132
MQE-1704: MFTF Compatibility with PHPUnit 9 #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Upgraded PhpUnit + Codeception
Added codeception modeule-* dependencies to fix functional tests
fixed static checks
Fixed phpmd error
Removed pauseExecution to use pause
Override switchToIFrame to include find by ID.
fixed static checks, fixed for MagentoAllureAdapter
Updated to PHPUnit 9 and fixed unit tests
remove PHP 7.2 support
6e3d1ba
to
a23844b
Compare
added Pause to MagentoWebDriver.php for step generation in console/allure
@@ -309,9 +315,28 @@ function () use ($rootStep, $formattedSteps) { | |||
|
|||
$this->getLifecycle()->getStepStorage()->put($rootStep); | |||
|
|||
$this->addAttachmentEvent($testEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changed in codeception that requires this new line + functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testEnd of codeception has changed to the below, it takes a TestEvent parameter and fires an event. I don't see any changes to due to this addition in test runs/allure. I'm not 100% sure what this change does, any thoughts? TestEvent needed to be used in overriding function in MagentoAllureAdapter, hence the addition.
public function testEnd(TestEvent $testEvent)
{
// attachments supported since Codeception 3.0
if (version_compare(Codecept::VERSION, '3.0.0') > -1 && $testEvent->getTest() instanceof Cest) {
$artifacts = $testEvent->getTest()->getMetadata()->getReports();
foreach ($artifacts as $name => $artifact) {
Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null));
}
}
$this->getLifecycle()->fire(new TestCaseFinishedEvent());
}
* @return void | ||
* @throws \Exception | ||
*/ | ||
public function switchToIFrame($locator = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a backwards compatible workaround to a new codeception version right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, switchToIFrame of PHPUnit9 takes in a name, css or xpath. Looks like it dropped support for Id. Overriding to support Id since a lot of tests find by Id.
#673) * MQE-2078: [PHPUnit 9] assertContains and assertNotContains breaking changes added new actions assertStringContainsString assertStringContainsStringIgnoringCase * MQE-2078: [PHPUnit 9] assertContains and assertNotContains breaking changes Added additional documentation for assertContains * Grammar fixes Co-authored-by: Donald Booth <dobooth@adobe.com>
Upgraded PhpUnit + Codeception
Changes -
Description
Fixed Issues (if relevant)
Contribution checklist